#version 330

uniform sampler2D normalTex;

uniform vec4 ambientColor; 
uniform vec4 diffuseColor; 
uniform vec4 specularColor; 
uniform float shininess;

//in vec4 N;
in vec4 v;
in vec4 cIndex;

void main (void)  
{  
   //vec3 L = normalize( vec3(0.5f, 1.0f, 2.0f) - v.xyz);   
  // vec3 E = normalize(-v.xyz);
  // vec3 R = normalize(-reflect(L,N.xyz));  
 
   //// ambient term
   //vec4 Iamb = ambientColor;
   //vec4 Iamb;
   //if( cIndex < 1.5 )				Iamb = vec4( 1.0, 0.0, 0.0, 0.0 );
   //else if( cIndex < 2.5 )			Iamb = vec4( 0.0, 1.0, 0.0, 0.0 );
   //else if( cIndex < 3.4 )			Iamb = vec4( 0.0, 0.0, 1.0, 0.0 );
   //else if( cIndex < 4.5 )			Iamb = vec4( 0.0, 1.0, 1.0, 0.0 );
   //else if( cIndex < 5.4 )			Iamb = vec4( 0.8, 0.5, 0.0, 0.0 );
   //else if( cIndex < 6.5 )			Iamb = vec4( 0.2, 1.0, 0.8, 0.0 );
   //else if( cIndex < 7.4 )			Iamb = vec4( 0.4, 0.2, 2.0, 0.0 );
   //else 							Iamb = vec4( 1.0, 1.0, 1.0, 0.0 );
	
	vec4 Iamb = cIndex;


   //// diffuse term
   //vec4 Idiff = diffuseColor * max(dot(N.xyz,L), 0.0);
   //Idiff = clamp(Idiff, 0.0, 1.0);     
   //
   //// specular term
   //vec4 Ispec = specularColor * pow(max(dot(R,E),0.0), 0.3 * shininess);
   //Ispec = clamp(Ispec, 0.0, 1.0);

   gl_FragColor = Iamb; //+ Idiff + Ispec;
}